﻿using System.Net;
using System.Xml.Serialization;

namespace Toybox.NicoSharp.Live
{
	using Extensions;
	using Primitives;
	using Utilities;

	/// <summary>
	/// ハードビート
	/// </summary>
	[XmlRoot("heartbeat")]
	public class HeartBeat : AbstractLiveStatus
	{

		#region [Static]

		/// <summary>
		/// HeartBeat 取得
		/// </summary>
		/// <param name="completeId"></param>
		/// <param name="cookies"></param>
		/// <returns></returns>
		public static HeartBeat Get(string completeId, CookieCollection cookies = null)
		{
			string data = "v=" + completeId;
			string html = NicoWebClient.Post(NicoUrls.WatchLiveApi + "heartbeat", data, cookies.Coerce());
			return Deserializer.XmlDeserializer<HeartBeat>(html);
		}

		#endregion [Static]


		#region Public Members

		/// <summary>
		/// 来場者数
		/// </summary>
		public int watchCount { get; set; }

		/// <summary>
		/// コメント数
		/// </summary>
		public int commentCount { get; set; }

		/// <summary>
		/// 制限
		/// </summary>
		public string is_restrict { get; set; }

		/// <summary>
		/// チケット
		/// </summary>
		public string ticket { get; set; }

		/// <summary>
		/// 待機時間
		/// </summary>
		public string waitTime { get; set; }

		#endregion Public Members

	}
}